//==============================================================================
//	File:		$RCSfile: BlinkyExample.rdl,v $
//	Version:	$Revision: 1.1 $
//	Desc:		RDL Counter Example
//	Author:		Greg Gibeling
//	Copyright:	Copyright 2005-2007 UC Berkeley
//
//	This copyright header must appear in all derivative works
//==============================================================================

//==============================================================================
//	Section:	License
//==============================================================================
// Copyright (c) 2005-2007, Regents of the University of California
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
//     - Redistributions of source code must retain the above copyright notice,
//         this list of conditions and the following disclaimer. 
//     - Redistributions in binary form must reproduce the above copyright
//         notice, this list of conditions and the following disclaimer
//         in the documentation and/or other materials provided with the
//         distribution. 
//     - Neither the name of the University of California, Berkeley nor the
//         names of its contributors may be used to endorse or promote
//         products derived from this software without specific prior
//         written permission. 
// 
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//==============================================================================

//==============================================================================
//	Section:	CVS Change Log
//==============================================================================
//	$Log: BlinkyExample.rdl,v $
//	Revision 1.1  2007/03/24 19:46:13  sshd_server
//	Implemented & Tested
//	
//==============================================================================

//------------------------------------------------------------------------------
//	Unit:		Blinky
//	Desc:		The core of this example is this simple blinker, notice that it
//				has no input or output channels, but it does have a simple
//				external set of signals, which could be used to control a row
//				of LEDs.  It's a valuable exercise to try and take the platforms
//				from the CounterExample, and map this unit to them.  If you
//				also change the "External" plugin below, you should be able to
//				get a few LEDs on a board to flash.  Don't forget to set
//				the value of $width, below to the number of LEDs you have.
//				Note that the delay bits parameter controls the width of the
//				delay counter, if you change the clock frequency (by e.g. going
//				to an FPGA) you will need to change the $delaybits.
//------------------------------------------------------------------------------
unit <width = 8, delaybits = 2> {
	// See the CounterExample if you want to know how to map this to a
	// platform other than ModelSim, e.g. one which represents a physical
	// board.
	plugin "Verilog" "External"<"Output", $width /*, "loc", "??,??,??"*/> LED;
}												Blinky;
//------------------------------------------------------------------------------

//------------------------------------------------------------------------------
//	Namespace:		Platforms
//	Desc:			This namespace holds the various platforms for which the
//					the counter example code has been implemented and tested.
//------------------------------------------------------------------------------
namespace {
	//--------------------------------------------------------------------------
	//	Platform:	ModelSim
	//	Desc:		This platform represents ModelSim SE.  It will cause the
	//				appropriate test bench code to be generated and, if back
	//				end plugins are enabled, it will launch ModelSim and run a
	//				simulation.  See the map ::Maps::ModelSim, which will
	//				actually instantiate this platform.
	//--------------------------------------------------------------------------
	platform {
		language 								"Verilog";
		plugin	"ModelSimEngine"				Engine;			// Use the ModelSim engine plugin to generate the engine
		plugin	"ModuleLibrary"<"ModuleLibrary.xml"> Library;	// Use the standard verilog module library.
		plugin	"ModelSim"						Launch;			// Launch ModelSim (assuming vsim is on your path)
	}											ModelSim;
	//--------------------------------------------------------------------------
}												Platforms;
//------------------------------------------------------------------------------

//------------------------------------------------------------------------------
//	Namespace:		Maps
//	Desc:			This namespace holds the various mappings of the blinky
//					example to the platforms specified in the ::Platforms
//					namespace.
//------------------------------------------------------------------------------
namespace {
	//--------------------------------------------------------------------------
	//	Map:		ModelSim
	//	Desc:		Maps the blinky example to ModelSim SE.  This should be
	//				specified as the "Dynamic Root ID" to the RDLC2 map
	//				command, to generate a complete system in Verilog.  If you
	//				enable "autoshells", "plugins" and "back end plugins" as
	//				well, then RDLC2 will automatically generate a ModelSim
	//				DO script, launch ModelSim and simulate for a while.
	//--------------------------------------------------------------------------
	map {
		unit		::Blinky					Unit;
		platform	::Platforms::ModelSim		Platform;
	}											ModelSim;
	//--------------------------------------------------------------------------
}												Maps;
//------------------------------------------------------------------------------